import {
  Controller,
  Get, UseGuards,
} from '@nestjs/common';
import { ApiOkResponse, ApiOperation, ApiTags } from '@nestjs/swagger';
import { EvaluationProjectService } from './evaluation-project.service';
import { EvaluationProjectAllResult } from "@/module/evaluation-project/evaluation-project.result";
import { AdminAuthGuard } from "@/common/auth/admin-auth.guard";

@Controller('/v1/admin/evaluation-projects')
@ApiTags('EvaluationProject_admin')
@UseGuards(AdminAuthGuard)
export class EvaluationProjectV1AdminController {
  constructor(private readonly evaluationProjectService: EvaluationProjectService) {
  }

  @Get('/all')
  @ApiOperation({ summary: '全部' })
  @ApiOkResponse({ type: EvaluationProjectAllResult, isArray: true })
  async all(): Promise<EvaluationProjectAllResult[]> {
    const res = await this.evaluationProjectService.all();
    return res;
  }
}
